home *** CD-ROM | disk | FTP | other *** search
/ Aminet 1 (Walnut Creek) / Aminet - June 1993 [Walnut Creek].iso / aminet / text / misc / ht.lha / hypertext / .edrc next >
Text File  |  1990-12-23  |  8KB  |  231 lines

  1. # This file contains essentially two parts.  This first part (right below)
  2. # is my "generic" setup for use with DME.  These bindings just happen to
  3. # be what I've gotten used to using after about a year and a half with DME.
  4. # The second part of the file contains the macros that work with HT.  You
  5. # can cut that second part out if you like and append it to your own .edrc
  6. # file, or you can just use this setup.
  7.  
  8. # left and right cursor-keys with line-wraparound
  9. map `left'   `ifelse l `if !t `up last'' left'
  10. map `right'  `ifelse r `if !b `down first'' right'
  11.  
  12. resettoggle 179
  13. map `sL-lmb'   `if 179 unblock tomouse block ifelse cb `bsave ram:dme.L.clip settoggle 179' `resettoggle 179''
  14. map `cL-lmb'   `goto start'
  15. map `aL-lmb'   `goto end'
  16. map `saL-lmb'  `tomouse insfile ram:dme.L.clip'
  17. map `csaL-lmb' `bsave ram:dme.L.clip bdelete'
  18.  
  19. # same as definitions above, except utilize right mouse-button and operate upon the right clipboard
  20. map `sR-rmb'   `if 179 unblock tomouse block ifelse cb `bsave ram:dme.R.clip settoggle 179' `resettoggle 179''
  21. map `cR-rmb'   `goto start'
  22. map `aR-rmb'   `goto end'
  23. map `saR-rmb'  `tomouse insfile Ram:dme.R.clip'
  24. map `csaR-rmb' `bsave Ram:dme.R.clip bdelete'
  25.  
  26.  
  27. # miscellaneous
  28. map `c-k'    `remeol'
  29. map `tab'    `tab'
  30. map `s-tab'  `backtab'
  31.  
  32. insertmode on
  33. savetabs on
  34.  
  35. resettoggle 1
  36. resettoggle 2
  37. map (A-r) (if 2 (toggle 2) settoggle 1 escimm (findr ))
  38. map (A-s) (if 1 (toggle 1) settoggle 2 escimm (find ))
  39. map (A-g) (ifelse 1 (nextr) (if 2 next))
  40. map (A-o) (escimm (newfile ) chfilename \$filename)
  41. map (A-w) (if m saveold)
  42. map (A-q) (quit)
  43. map (A-k) (unblock block block bsave RAM:dme.line.temp bdelete first)
  44. map (A-l) (insfile RAM:dme.line.temp)
  45. map (A-b) (block)
  46. map (A-x) (bsave RAM:dme.temp bdelete)
  47. map (A-c) (bcopy unblock)
  48. map (A-i) (insfile RAM:dme.temp)
  49. map (A-p) `escimm `Press [RETURN] to Print, [ESC] to stop' saveas `PRT:''
  50. map (A-t) (ifelse 0 (toggle 0 top) (toggle 0 bottom))
  51. map (cA-e) (unblock block block bsource unblock)
  52.  
  53. map (R-rmb) (MENUON)
  54. map (bs) (ifelse !l (bs) (up last join))
  55. map (del) (ifelse !r (del) (join))
  56. map (tab) ((    ))
  57. map (a-del) (ifelse !r (del) (join))
  58. map (return) (split down first)
  59. map (f1) (saveold iconify)
  60.  
  61. #some emacs style movement commands...
  62. map (c-n) (DOWN)
  63. map (c-p) (up)
  64. map (c-e) (last)
  65. map (c-a) (first)
  66. map (c-f) (right)
  67. map (c-b) (left)
  68. #kludge here to get DME to differentiat between the key del and the command del
  69. map (c-d) (a-del)
  70.  
  71. map (c-l) (arpload)
  72. map (c-;) (esc)
  73. map (c-left) first
  74. map (c-right) last
  75. map (c-up) (top)
  76. map (c-down) (bottom)
  77.  
  78. map (s-left) (wleft)
  79. map (s-right) (wright)
  80. map (s-up) (pageup)
  81. map (s-down) (pagedown)
  82.  
  83. menuoff
  84.  
  85. menuadd Project Clear (newfile unnamed)
  86. menuadd Project Save (if m saveold)
  87. menuadd Project (Save As) (arpsave)
  88. menuadd Project Open (arpload chfilename \$filename)
  89. menuadd Project (Insert File) (escimm (insfile ))
  90. menuadd Project (Dos Command...) (escimm (execute ))
  91. menuadd Project (More DME!) (newwindow arpload)
  92. menuadd Project NewCLI (execute c:newcli)
  93. menuadd Project Quit (quit)
  94.  
  95. menuadd Edit (Block on/off) (block)
  96. menuadd Edit (Cut Block) (bsave RAM:dme.temp bdelete)
  97. menuadd Edit Copy (bcopy)
  98. menuadd Edit Paste (insfile RAM:dme.temp)
  99. menuadd Edit UnHighlite (unblock)
  100.  
  101. menuadd Tools Search (escimm (find ))
  102. menuadd Tools Replace (escimm (findr ))
  103. menuadd Tools (Repeat Search) (next)
  104. menuadd Tools (Repeat Replace) (nextr)
  105. menuadd Tools (Global Replace) (escimm (findstr ) escimm (repstr ) repeat lbot (nextr))
  106. menuadd Tools (Ignore Case on S&R) (ignorecase toggle)
  107. menuadd Tools (Mark Spot) (ping 1)
  108. menuadd Tools (Jump to Spot) (pong 1)
  109. menuadd Tools Insert (insertmode on)
  110. menuadd Tools Overwrite (insertmode off)
  111. menuadd Tools LF->CRLF      (top repeat -1 (last tlate 13 down))
  112. menuadd Tools CRLF->LF      (top repeat -1 (last left if c=13 del down))
  113.  
  114. menuon
  115.  
  116.  
  117. # My own settings for DME
  118. # © Mikael Karlsson
  119. # Distribute as you wish but don't claim them for your own creation.
  120.  
  121. addpath s:
  122.  
  123. map `c-ret'     `last'
  124.  
  125. #Extra stuff
  126.  
  127. map `s-help'    (newwindow)
  128. map `a-t'       (block block down down bmove up)
  129. map `s-bs'      (left while c=32 (del left) ifelse ca (while ca (right bs left)) (while !ca (right bs left)) right)
  130. map `tab'       (ifelse t (tab) (up s-right down))
  131. map `bs'        (ifelse l (up last join if !l (del)) (bs))
  132.  
  133. # This does auto indenting.
  134. map `return'    (split first while c=32 (down ` ' up) if c=123 (down ` ' up) while c=32 (down ` ' up) down)
  135.  
  136. #C-Style
  137.  
  138. map `('         (`()' left)
  139. map `)'         `ifelse c=41 `right' ``)'''
  140.  
  141. map `{'         (`{ }' left)
  142. map `}'         (ifelse c=125 (c-bs c-bs right) (`}'))
  143. map `['         (`[]' left)
  144. map `]'         (ifelse c=93 (right) (`]'))
  145. map `"'         (ifelse c=34 (right) (`""' left))
  146. map `;'         (ifelse c=125 (`;' -return) (`;'))
  147.  
  148.  
  149. #######################################################################
  150. ##
  151. ##              HT SECTION
  152. ##
  153. #######################################################################
  154. #    The following macros are designed to be used from within DME when
  155. # creating documents for HT.  Their purpose is to make life a little
  156. # easier and faster.  Just source this file when you want to work on
  157. # HT documents (and also make sure that REXX will be able to find the
  158. # dme macros).
  159. #
  160. #    I used "alt" based keymappings because I figured they wouldn't
  161. # conflict with keymaps you already have.
  162. #    Feel free to change the keymappings as you see fit.  I thought they
  163. # made sense, maybe you don't.
  164. #
  165. # D.B.G. July 1990
  166.  
  167. # The "test macro".  It will save the current filename, then call an
  168. # Arexx macro to load this file directly into HT
  169. #
  170. map a-t (saveold rx1 test \$filename)
  171. # for ease of typing, we'll add this too.
  172. map c-t (a-t)
  173.  
  174. # These (tiny) macros are setup to insert the necessary text to turn
  175. # on (and off) the specified attributes.
  176. #   Oh, BTW - all the backslashes *are* necessary as far as I know ;-(
  177. map a-b ( `\\\\Bold ' )
  178. map a-i ( `\\\\Italic ' )
  179. map a-u ( `\\\\Underline ' )
  180. map a-c ( `\\\\Center ' )
  181. map a-d ( `\\\\Indent ' )
  182. map a-f ( `\\\\Format ' )
  183. map a-r ( `\\\\FreeFormat ' )
  184.  
  185.  
  186. #   And the two biggie macros.... these handle creating a link in your
  187. # document.  Since DME doesn't do char based highlighting/blocking we
  188. # have to do a Start link (a-s) to know exactly where to start the link
  189. # and then the actual LINK macro which will call an Arexx macro to
  190. # pop up a window which you use to specify your link.  The Arexx macro
  191. # then inserts the appropriate text into your document at the right spots.
  192.  
  193. #
  194. #   The first macro is used to define where to START the link,
  195. # I have used text markers 8 and 9 pretty arbitrarily.    Change them
  196. # here and in link.dme if they conflict with what you use them for
  197. map a-s (ping 8)
  198.  
  199. # and the second macro actually makes the call...
  200. map a-l (ping 9 rx do_link)
  201.  
  202. # the do_link.dme macro depends on the following definition for proper
  203. # cursor movement on the screen.  It is obscure enough that I doubt anyone
  204. # has it defined.  (would you really press ctrl-alt-shift nk6?)
  205. map cas-nk6 (ifelse r (if !b (down first)) right)
  206.  
  207. # Here we add some menus to the window so that we can have some
  208. # user-friendliness... (ackk, cough, gasp ! user-friendly, what a horrible
  209. # word ;-)
  210. #
  211. # If you don't want this stuff, just comment it out - it doesn't do or
  212. # add anything extra.
  213.  
  214. menuoff
  215. menuadd HyperText `Bold on/off'      (a-b)
  216. menuadd HyperText `Italics on/off'   (a-i)
  217. menuadd HyperText `Underline on/off' (a-u)
  218. menuadd HyperText `Center on'        (a-c)
  219. menuadd HyperText `Indent Paragraph' (a-i)
  220. menuadd HyperText `Formatting ON'    (a-f)
  221. menuadd HyperText `Formatting OFF'   (a-r)
  222. menuadd HyperText ()                 (null)
  223. menuadd HyperText `Define Setup Info'(setup)
  224. menuadd HyperText ()                 (null)
  225. menuadd HyperText `Start Link'       (a-s)
  226. menuadd HyperText `Define Link'      (a-l)
  227. menuadd HyperText () (null)
  228. menuadd HyperText `Test current Document' (a-t)
  229. menuon
  230.  
  231.